package Lab01;
import java.io.*;
import java.awt.*;
import java.lang.*;


public class Account {
	public long SoTK;
	public String TenTK;
	public double SoTien;
	final float laisuat = (float)0.02;
	final  int phirut = 1;
	
	public Account(){
		this.SoTK = 0;
		this.TenTK = null;
		this.SoTien = 0;
	}
	public Account(long SoTK, String TenTK){
		this.SoTK = SoTK;
		this.TenTK = TenTK;
		this.SoTien = 100;
	}
	
	public long getSoTK(){
		return SoTK;
	}
	public void setSoTK(long SoTK1){
		this.SoTK = SoTK1;
	}
	
	public String getTenTk(){
		return TenTK;
	}
	public void setTenTK(String TenTK1){
		extracted();
	}
	private String extracted() {
		return this.TenTK = TenTK;
	}
	
	public double getSoTien(){
		return SoTien;
	}
	public void setSoTien(double SoTien1){
		this.SoTien = SoTien1;
	}
	
	public void display(){
		System.out.print("So Tai Khoan: " + this.SoTK +"\nTen Tai Khoan: "+ this.TenTK + "\nSo Tien: "+this.SoTien+"\n");
	}
	
	public void nap_tien(double SoTien1){
		if(SoTien1<0)		System.out.print("So tien nap phai > 0");
		this.SoTien = SoTien + SoTien1;
	}
	public void rut_tien(double SoTien1){
		if(SoTien1 < this.SoTien){
			System.out.print("so tien co trong tai khoan khong du de rut vui long nhap lai so tien");
		}
		else if(SoTien1 < 10){
			System.out.print("so tien rut phai > 10 vui long nhap lai so tien");
		}
		else {
			this.SoTien = SoTien - SoTien1 - phirut;
		}
	}
	public void dao_han(){
		this.SoTien = SoTien + SoTien*laisuat;
	}
	public void chuyen_khoan(Account Account1, double SoTien1){
		this.rut_tien(SoTien1);
		Account1.nap_tien(SoTien1);
	}
}
